From 8b40845acab5f47593409bc0c019ec344645b4b6 Mon Sep 17 00:00:00 2001 From: robertl Date: Sun, 17 Jan 2010 21:57:00 +0000 Subject: [PATCH] Show upgrade testing mode in 'about' dialog. Tweak (some, not all) copyright notices per discussion with Khai Mong. Misc warning cleanups. --- gui/aboutdlg.cpp | 8 +++++++- gui/aboutui.ui | 30 ++++++++++++++++-------------- gui/format.h | 6 +++--- gui/serial_mac.cpp | 4 ++-- gui/upgrade.cpp | 9 +++++++-- gui/upgrade.h | 3 ++- 6 files changed, 37 insertions(+), 23 deletions(-) diff --git a/gui/aboutdlg.cpp b/gui/aboutdlg.cpp index 5da87827d..e1e251580 100644 --- a/gui/aboutdlg.cpp +++ b/gui/aboutdlg.cpp @@ -1,5 +1,5 @@ // -*- C++ -*- -// $Id: aboutdlg.cpp,v 1.1 2009/07/05 21:14:56 robertl Exp $ +// $Id: aboutdlg.cpp,v 1.2 2010/01/17 21:57:00 robertl Exp $ //------------------------------------------------------------------------ // // Copyright (C) 2009 S. Khai Mong . @@ -22,6 +22,7 @@ #include "aboutdlg.h" #include "appname.h" +#include "upgrade.h" AboutDlg::AboutDlg(QWidget *parent, const QString &ver1, const QString &ver2): QDialog(parent) @@ -33,6 +34,11 @@ AboutDlg::AboutDlg(QWidget *parent, const QString &ver1, tt.replace(QRegExp("\\$appname\\$"), QString(appName)); tt.replace(QRegExp("\\$babelversion\\$"), ver1); tt.replace(QRegExp("\\$babelfeversion\\$"), ver2); + + // Not localized as it should never be seen. + tt.replace(QRegExp("\\$upgradetestmode\\$"), + UpgradeCheck::isTestMode() ? "**Upgrade test mode**" : ""); + doc->setHtml(tt); QTextCursor cur(doc); cur.setPosition(0); diff --git a/gui/aboutui.ui b/gui/aboutui.ui index b359e6f81..1221851a1 100644 --- a/gui/aboutui.ui +++ b/gui/aboutui.ui @@ -74,20 +74,22 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'DejaVu Sans'; font-size:9pt; font-weight:400; font-style:normal;"> -<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">$appname$</span></p> -<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">$babelfeversion$</p> -<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Copyright (C) 2009 S. Khai Mong</p> -<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">LGPL Crystal Icons by Alvarado Coehlo</p> -<p align="center" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p> -<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">(Using backend $babelversion$)</p> -<p align="center" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.</p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.</p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 USA</p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p></body></html> +</style></head><body style=" font-family:'Lucida Grande'; font-size:13pt; font-weight:400; font-style:normal;"> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:9pt; font-weight:600;">$appname$</span></p> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:9pt;">$babelfeversion$</span></p> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:9pt;">Copyright (C) 2009 Robert Lipe</span></p> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:9pt;">GUI designed and contributed by S. Khai Mong</span></p> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:9pt;">LGPL Crystal Icons by Alvarado Coehlo</span></p> +<p align="center" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'DejaVu Sans'; font-size:9pt;"></p> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:9pt;">(Using backend $babelversion$)</span></p> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:9pt;">$upgradetestmode$</span></p> +<p align="center" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'DejaVu Sans'; font-size:9pt;"></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:9pt;">This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'DejaVu Sans'; font-size:9pt;"></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:9pt;">This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'DejaVu Sans'; font-size:9pt;"></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:9pt;">You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 USA</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'DejaVu Sans'; font-size:9pt;"></p></body></html> diff --git a/gui/format.h b/gui/format.h index d2e18316f..47032468e 100644 --- a/gui/format.h +++ b/gui/format.h @@ -1,5 +1,5 @@ // -*- C++ -*- -// $Id: format.h,v 1.3 2010/01/17 01:42:10 robertl Exp $ +// $Id: format.h,v 1.4 2010/01/17 21:57:00 robertl Exp $ //------------------------------------------------------------------------ // // Copyright (C) 2009 S. Khai Mong . @@ -124,7 +124,7 @@ class Format bool fileFormat, bool deviceFormat, const QStringList &extensions, QList &inputOptions, - QList &outputptions, + QList &outputptions, const QString &html): name(name), description(description), readWaypoints(readWaypoints), readTracks(readTracks), readRoutes(readRoutes), @@ -136,8 +136,8 @@ class Format html(QString()), readUseCount_(0), writeUseCount_(0) - { + (void)html; // suppress 'unused' warning. } Format(const Format &c): diff --git a/gui/serial_mac.cpp b/gui/serial_mac.cpp index 1c4d09656..140975798 100644 --- a/gui/serial_mac.cpp +++ b/gui/serial_mac.cpp @@ -71,8 +71,8 @@ // Function prototypes static kern_return_t FindModems(io_iterator_t *matchingServices); -static kern_return_t GetModemPath(io_iterator_t serialPortIterator, char *bsdPath, CFIndex maxPathSize); -static int OpenSerialPort(const char *bsdPath); +// static kern_return_t GetModemPath(io_iterator_t serialPortIterator, char *bsdPath, CFIndex maxPathSize); +// static int OpenSerialPort(const char *bsdPath); // Returns an iterator across all known modems. Caller is responsible for // releasing the iterator when iteration is complete. diff --git a/gui/upgrade.cpp b/gui/upgrade.cpp index 91540ba0f..0020b682e 100644 --- a/gui/upgrade.cpp +++ b/gui/upgrade.cpp @@ -1,7 +1,7 @@ // -*- C++ -*- -// $Id: upgrade.cpp,v 1.18 2010/01/17 01:42:10 robertl Exp $ +// $Id: upgrade.cpp,v 1.19 2010/01/17 21:57:00 robertl Exp $ /* - Copyright (C) 2009 Robert Lipe, robertlipe@gpsbabel.org + Copyright (C) 2009, 2010 Robert Lipe, robertlipe@gpsbabel.org This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -56,6 +56,11 @@ UpgradeCheck::~UpgradeCheck() } } +bool UpgradeCheck::isTestMode() +{ + return testing; +} + QString UpgradeCheck::getOsName(void) { // Do not translate these strings. diff --git a/gui/upgrade.h b/gui/upgrade.h index 78704b421..7b5bb148b 100644 --- a/gui/upgrade.h +++ b/gui/upgrade.h @@ -1,7 +1,7 @@ #ifndef UPGRADE_H #define UPGRADE_H /* - Copyright (C) 2009 Robert Lipe, robertlipe@gpsbabel.org + Copyright (C) 2009, 2010 Robert Lipe, robertlipe@gpsbabel.org This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -49,6 +49,7 @@ public: QDateTime getUpgradeWarningTime() { return upgradeWarningTime; } + static bool isTestMode(void); protected: -- 2.30.2